﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//
using PharmacyBussinesEntities;
using PharmacyService;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using System.Web.ModelBinding;
namespace PharmacyWeb.Ventas
{
    public partial class FrmBuscarCliente : System.Web.UI.Page
    {
        [Dependency]
        public IClienteService ClienteService { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            var accion = Request.QueryString["accion"];
            var idc = Request.QueryString["id"];
            if (accion != null && accion == "eliminar" && idc != null)
            {
                var idcc = Int32.Parse(idc.ToString());
                ClienteService.RemoveCliente(idcc);
                Response.Redirect("FrmBuscarCliente.aspx");
            }
            
        }
        public IEnumerable<Cliente> GetClientes([Control("xtxcriteriow")]string criterio)
        {
            return ClienteService.GetClientesByCriterio(criterio);
        }


        
    }
}